package com.zhdl.hardware_contact.hardware_config.entity;

import com.project.common.bean.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;


/**
 * 硬件-参数配置化表
 */
@Data
@Entity
@EqualsAndHashCode(callSuper = true)
@Table(name = "hardware_project_config")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
public class ProjectConfiguration extends BaseEntity<ProjectConfiguration, Integer> {
    /**
     * 硬件地址-所属从站
     *
     * @mock 默认值 01
     */
    public String slaveAddress = "01";
    /**
     * 硬件地址-所属DB块
     *
     * @mock 默认值 DB0
     */
    public String dbAddress = "DB0";
    /**
     * 硬件地址-硬件地址
     */
    public String address;
    /**
     * 硬件地址-字段
     */
    public String field;
    /**
     * 硬件地址-值
     */
    public String value;
    /**
     * 硬件地址-值类型
     */
    public int valueType;
    /**
     * 硬件地址-值长度
     */
    public int length;
    /**
     * 硬件操作-操作权限
     */
    public int permissions;
    /**
     * 项目-展示分组
     */
    public String groupType;

    //项目描述-已有描述字段 暂时隐藏
    public String remarks;
    /**
     * 项目编号
     */
    public String project;
    /**
     * Id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;


    @Column(name = "workplace_id")
    public Integer workplaceId;

    public ProjectConfiguration(String field,String value,int valueType){
        this.field = field;
        this.value = value;
        this.valueType = valueType;
    }
    public ProjectConfiguration(String field,String value,int valueType,String address){
        this.field = field;
        this.value = value;
        this.valueType = valueType;
        this.address = address;
    }
    public ProjectConfiguration(){

    }


}
